<!DOCTYPE html>
<html>
  <head>
    <script src="../dist/jspsych.js"></script>
    <script src="../dist/plugin-html-keyboard-response.js"></script>
    <link rel="stylesheet" href="../dist/jspsych.css">
  </head>
  <body></body>
  <script>

    var jsPsych = initJsPsych({
      on_finish: function() {
        jsPsych.data.displayData();
      },
      default_iti: 250
    });

    var timeline_variables = [
      { v1: "<p>1</p>" },
      { v1: "<p>2</p>" },
      { v1: "<p>3</p>" },
      { v1: "<p>4</p>" },
      { v1: "<p>5</p>" },
      { v1: "<p>6</p>" }
    ];

    var node = {
      timeline_variables: timeline_variables,
      timeline: [
        {
          type: jsPsychHtmlKeyboardResponse,
          choices: "ALL_KEYS",
          stimulus: jsPsych.timelineVariable('v1'),
        }
      ],
      sample: {
        type: 'custom',
        fn: function(x){ return x.reverse(); }
      },
      repetitions: 2
    };

    jsPsych.run([node]);

  </script>
</html>
